const {Comment} = require('../../model/comment');

module.exports = async function (req, res) {
  const {content, aid, uid} = req.body;
  await Comment.create({
    content,
    aid,
    uid,
    time: new Date()
  });
  res.redirect('/home/article?id='+aid);
}